"""

    使用numpy 计算大型矩阵的平均值

"""

import numpy as np
import time


def compute():
    data_points = 4000000000

    rows = 50

    columns = int(data_points / rows)

    matrix = np.arange(data_points).reshape(rows, columns)

    s = time.time()

    res = np.mean(matrix, axis=1)

    print(time.time() - s)


compute()
